winsound

Read about winsound, The latest news, videos, and discussion topics about winsound from alibabacloud.com

Forwarded from column Liu Xin: python _ simple sound playback function

Http://blog.csdn.net/jj_liuxin/archive/2008/12/21/3574638.aspx Just take a look at the python 3.0 documentation and find a very pythonic module: sound playback for windows; a buzzword called "silly and naive", which is quite easy. 1> winsound. BEEP2> winsound. playsound () Each one has a different usage. Let's look at it one by one.1> winsound. Beep (frequency, d

Python allows you to play music at regular intervals with an alarm clock and python to play music.

Python allows you to play music at regular intervals with an alarm clock and python to play music. You can only play audio in wav format for your reference. The specific content is as follows: Python code: Import time import sys soundFile = 'sound.wav 'not_executed = 1 def soundStart (): if sys. platform [: 5] = 'linux ': import OS. popen2 ('aplay-Q' + soundFile) else: import winsound. playSound (soundFile, winsou

Python Monitoring Log Program

A simple log monitoring script with the following functions: 1.windows environment 2. When the log keyword is matched, a sound is emitted, different keywords are matched, and different sounds are played 3. Real-time response possible Note: It is in the win environment OH Go directly to the code. #!/usr/bin/env python# encoding:utf-8 "" "monitorlog.py Usage:MonitorLog.py ... Monitor the log file-f log file-h help info python monitorlog.py-f C:\monitor.log "" "Import sysimport Osimpor T getoptimp

An interactive alarm clock written in Python

#filename my little alarm clock.Import timeImport SysImport WinSoundA=time.ctime ()Print ("***************** Pro is Now", A, "**********************")Print ("*********************** welcome you to use Shup DIY alarm Clock applet ***********************")Hour1=int (Input ("*****************", enter the hour you want to set the alarm (for example, 10): "))Minutes=int (Input ("**************** Pro, please enter the minutes to set the alarm (e.g. 20):"))i = 3O=3While I:A= list (Time.localtime ()) #获

Python calls the machine horn beep (Beep) method

This article mainly introduces the python calls the machine horn beeps (Beep) The method, the example analyzes the python to invoke the WinSound module the use skill, needs the friend to be possible to refer to under The example in this article describes the way Python invokes the Beep (Beep) of the machine horn. Share to everyone for your reference. The specific analysis is as follows: The following Python code can call the machine horn beep (Beep

Python log monitoring (pronunciation)

: if k = '-F ': path = v elif k = '-H': print _ doc _ return 0 if not (path and OS. path. exists (path): print 'invalid path: % s' % path print _ doc _ return 2 # command line tuples cmd = ('tail', '-F ', path) print ''. join (cmd) output = subprocess. popen (cmd, stdout = subprocess. PIPE) keywordMap ={}# load monitoring keyword information with codecs. open (OS. path. join (ABSPATH, MONITERCONF), 'R', 'utf8') as f: lines = f. readlines () for line in lines: line = line. strip () if not line: c

C # Call winmm. DLL to play audio _ created in China

. The filter is set:C # copy to clipboardDialog1.filter = "WAV Files (*. wav) | *. wav "; C # copy to clipboardUsing system. Windows. forms; Namespace winsound{Public partial class form1: Form{Private textbox textbox1;Private button button1; Public form1 () // Constructor{Initializecomponent ();} [System. runtime. interopservices. dllimport ("winmm. dll", entrypoint = "playsound", setlasterror = true)]Private Static extern bool playsound (string szsou

Good doctor resets arbitrary users

provide this function, but you can enter from the intermediate web site, you can reset the user nameHttp://passport.haodf.com/user/sendpasswordsucc? Type = mobile username = xxxxxxx 3. Reset through emailSimilar to 1, resetting by mobile phone numberA simple EXP written in python# Encoding = utf8Username = 'init' Class MyHTTPRedirectHandler (urllib2.HTTPRedirectHandler ):Def http_error_302 (self, req, fp, code, msg, httpmsg ):For header in httpmsg. headers:If header. count ('username = ')> 0:G

Write a simple small program in python, compile it into exe and run it on win10, pythonwin10

beep for a while to remind me that I should go to work. This is mainly a new function, how to make the calculator beep. The Code is as follows (python 2.7 ):    1 #-*-coding: UTF-8-*-2 from tkinter import * # import Tkinter Library 3 import time, datetime, winsound, threading 4 5 root = Tk () 6 lbl = Label (root, text = "hello, world", width = 30, height = 2) 7 8 def tick (): 9 global timer10 timer = threading. timer (1.0, tick, "") 11 currenttime =

Peer Crawler-PAT loan

#-*-Coding:utf-8-*-import urllib2import reimport osimport sqlite3import winsound# Open database File ppdai_db = Sqlite3.connect (R ' C:\Users\Jian fang\desktop\ppdai.db ') cursor = Ppdai_db.cursor () # Build Table # Cursor.execute (' DROP table IF EXISTS tradelog ') # Cursor.execute (' CREATE TABLE tradelog (user_id varchar), Money varchar (+), rate varchar (), date varchar, time VA Rchar (10)) # define Regular expression pattern = Re

Recommended 10 articles for speakers

article mainly introduces the python calls the machine horn beeps (Beep) method, the example analysis Python calls the WinSound module the use skill, needs the friend to refer to the next 4. VC6.0 Small Problems and tips Introduction: Introduction to VC6.0 small problems and tips 1. Check if the parentheses in the program are matched move the cursor to the parentheses you want to detect, such as curly braces {}, brackets [], parentheses (), and angle

Python standard Library at a glance (Python advanced learning)

--access compiler symbol table 32.4.symbol--constants using Python parse tree 32.5.token- -Constants Use the Python parse tree 32.6.keyword--python test keyword 32.7.tokenize--the python source code compiler 32.8.tabnanny--detect ambiguous indentation 32.9.pyclbr-- Python class browser supports 32.10.py_compile--compiling python source files 32.11.compileall--byte-compile Python library 32.12.dis-- Disassembler python bytecode 32.13.pickletools--kimchi developer Tools 33. Various services 33.1.f

Python Intermediate--07 Standard library

--compiling Python source files32.11.compileall--byte-compile Python Library32.12.dis--Disassembler python bytecode32.13.pickletools--Kimchi Developer's tools33. A variety of services33.1.formatter--General-Purpose output format34.MS Windows-specific services34.1. msilib--Read and write Microsoft Installer files34.2.msvcrt--ms VC + + run-time useful program34.3 Winreg--windows Registry Access34.4.winsound--Sound Playback Interface window35.Unix Specif

List Python standard modules

source file participle 206. Tabnany: Fuzzy indentation detection207. Pyclbr: Python class browsing support 208. Py_compile: Compiling python source files 209. Compileall: Compiling python libraries by byteDis: The disassembler of Python bytecode 211. Pickletools: Serialization Development toolsOther212. Formatter: Universal formatted outputWindows- related213. Msilib: Read and write Windows Installer files 214. MSVCRT: A useful program for MS VC + + Runtime215. WinReg: Windows registry Access 2

Python Module Encyclopedia (very detailed!) ) __python

module 5.11. ZipFile module 5.12. Gzip Module mail and news message processing 6.1. Overview 6.2. RFC822 module 6.3. Mimetools module 6.4. Mimewriter module 6.5. Mailbox Module 6.6. Mailcap Module 6.7. Mimetypes Module 6.8. Packmail Module 6.9. Mimify Module 6.10. Multifile Module Network Protocol 7.1. Overview 7.2. Socket Module 7.3. Select Module 7.4. Asyncore Module 7.5. Asynchat module 7.6. Urllib Module 7.7. Urlparse module 7.8. Cookie module 7.9. Robotparser module 7.10. Ftplib module 7.1

Compile a simple program in python and compile it into an exe and run it on win10, pythonwin10

beep for a while to remind me that I should go to work. This is mainly a new function, how to make the calculator beep. The Code is as follows (python 2.7 ): #-*-Coding: UTF-8-*-from tkinter import * # import the Tkinter library import time, datetime, winsound, threadingroot = Tk () lbl = Label (root, text = "hello, world", width = 30, height = 2) def tick (): global timer = threading. timer (1.0, tick, "") currenttime = time. strftime ('% Y-% m-% d

Python 3.0 beta 1 ultra-Concise syntax usage

by many original versions have been corrected. Compared with the previous alpha versions, we can find that some infrastructure such as bytes, int, and unicode-related parts have gradually stabilized. For itertools, izip (), imap () all the things that replace builtin's zip, map, and other language features have been completed. It can be said that the core progress is quite good. It is estimated that the beta version is more about reorganizing the organization form of the database, fixing bugs,

Python-based plug-in system architecture test

start of the message.wav , you can like this: #plugins1. Pyimportosdefalert (): soundfile=os.path.join (Os.path.dirname (__ file__), "Message.wav") try:import winsoundwinsound. PlaySound (Soundfile,winsound. Snd_filename) except (importerror,runtimeerror): passclassplugin1:defsetplatform (self, Platform): self.platform=platformdef start (self): self.platform.sayhello ("Plugin1") alert () defstop (self): self.platform.saygoodbye ("Plugin1") Defgetpl

Communication principle Practice (i)--Audio signal processing

: Runing End methods Function obj=SOUNDCARDDAC (FS) Obj.m_fs=FS; Obj.m_ao= Analogoutput ('WinSound'); AddChannel (Obj.m_ao,1); Set(Obj.m_ao,'samplerate', OBJ.M_FS); Obj.m_state=1; fprintf (1,'info:create Soundcarddac object, fs=%d.\n', FS); End Function tx (obj, signal) sample_th1= Obj.m_fs *0.4; %ensure that the sound card has at least 0.4s or so length of data sample_th2= Obj.m_fs *0.6; %usually the sound card buffer data is not too long signal= Res

Python Standard Library

Module 7.20. Simplehttpserver Module 7.21. Cgihttpserver Module 7.22. CGI Modules 7.23. WebBrowser Module Internationalization 8.1. Locale Module 8.2. Unicodedata Module 8.3. Ucnhash Module Multimedia related modules 9.1. Overview 9.2. IMGHDR Module 9.3. SNDHDR Module 9.4. Whatsound Module 9.5. AIFC Module 9.6. Sunau Module 9.7. Sunaudio Module 9.8. Wave Module 9.9. Audiodev Modul

Total Pages: 2 1 2 Go to: Go

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.